home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et-2_2.lha / et2.2 / src / View.h < prev    next >
C/C++ Source or Header  |  1990-11-28  |  2KB  |  80 lines

  1. #ifndef View_First
  2. #ifdef __GNUG__
  3. #pragma once
  4. #endif
  5. #define View_First
  6.  
  7. #include "VObject.h"
  8.  
  9. extern bool gPrinting;
  10.  
  11. enum ViewFlags {
  12.     eViewNoPrint=   BIT(eVObjLast+1),
  13.     eViewLast   =   eVObjLast + 1
  14. };
  15.  
  16. enum ViewSizeDet {
  17.     eViewHFit   = BIT(0),
  18.     eViewVFit   = BIT(1),
  19.     eViewDefault= 0
  20. };
  21.  
  22. class View: public VObject {
  23.     class SeqCollection *clippers;
  24.     class EvtHandler *nexthandler;
  25. protected:
  26.     class Clipper *focus;
  27. public:
  28.     MetaDef(View);
  29.     
  30.     View(class EvtHandler *eh, Rectangle itsExtent, int id= -1);
  31.     ~View();
  32.     
  33.     void SetExtent(Point);
  34.     SeqCollection *GetClipperList()
  35.     { return clippers; }
  36.     void CheckOpen();
  37.     EvtHandler *GetNextHandler();
  38.     void SetNextHandler(EvtHandler *);
  39.     class Document *GetDocument();
  40.     Rectangle GetViewedRect();
  41.     
  42.     //---- Drawing ---------------------------------
  43.     void DrawAll(Rectangle, bool);
  44.     void InvalidateRect(Rectangle);
  45.     
  46.     virtual void ShowInAllClippers(VoidObjMemberFunc, Object *op,
  47.                 void* =0, void* =0, void* =0, void* =0); 
  48.                 // obsolete
  49.     virtual void Update();
  50.     
  51.     //---- Scrolling --------------------------------
  52.     void AddToClipper(class Clipper*);
  53.     void RemoveFromClipper(class Clipper*);
  54.     virtual void ConstrainScroll(Point*);
  55.     void RevealRect(Rectangle r, Point e);
  56.     void RevealAlign(Rectangle, VObjAlign al= (VObjAlign)(eVObjHLeft+eVObjVTop));
  57.     void Scroll(int mode, Point scroll, bool redraw= TRUE);
  58.     
  59.     //---- Clipboard --------------------------------
  60.     virtual bool CanPaste(char*);
  61.     virtual void SelectionToClipboard(char*, ostream &os);
  62.     virtual Command *PasteData(char*, istream &s);
  63.     virtual bool HasSelection();
  64.     
  65.     //---- Menu related methods ---------------------
  66.     void DoCreateMenu(class Menu*);
  67.     Command *DoMenuCommand(int cmd);
  68.     void DoSetupMenu(class Menu*);
  69.  
  70.     //---- Events -----------------------------------
  71.     Command *Input(Point, Token, Clipper*);
  72.     Command *DoCursorKeyCommand(EvtCursorDir, Point, Token);
  73.     Command *DoFunctionKeyCommand(int, Point, Token);
  74.     
  75.     //---- Inspecting -------------------------------
  76.     void InspectorId(char *buf, int sz);
  77. };
  78.  
  79. #endif View_First
  80.